package com.ymatou.iapi.delivery.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.common.collect.Lists;
import com.ymatou.iapi.delivery.parameter.ModifyOrSupplementBillNoInfo;
import com.ymatou.iapi.delivery.parameter.ModifyOrSupplementBillNoReq;
import com.ymatou.iapi.delivery.parameter.enums.CheckBizResultEnum;
import com.ymatou.iapi.delivery.parameter.resp.DeliveryCheckResp;
import com.ymatou.iapi.delivery.parameter.resp.DeliveryCheckResult;
import com.ymatou.iapi.delivery.parameter.resp.ExpectCheckResult;
import com.ymatou.iapi.delivery.service.DeliveryService;
import com.ymatou.iapi.delivery.service.ModifyOrSupplementBillNoCall;
import com.ymatou.iapi.optrade.parameter.enums.AuthenticateFeeTypeEnum;
import com.ymatou.iapi.optrade.parameter.enums.AuthenticateFreightTypeEnum;
import com.ymatou.iapi.optrade.parameter.enums.LogisticsTypeEnum;
import com.ymatou.iapi.optrade.parameter.utill.Utils;
import com.ymatou.iapi.optrade.resp.TradingServiceResp;
import com.ymatou.iapi.synctrade.service.TradingSyncService;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.AccountCallServiceV2;
import com.ymttest.business.service.YMTTrading.TradingCallService;
import com.ymttest.business.service.YMTTrading.TradingPlaceAuthenticateCallService;
import com.ymttest.business.service.YMTTrading.TradingPlaceOrderCallService;
import com.ymttest.database.sharding.db.ext.model.DeliveryPo;
import com.ymttest.database.sharding.db.sharding.model.OrderPo;
import com.ymttest.database.sharding.db.sqlwapper.OrderShardingWapper;
import com.ymttest.database.sharding.db.sqlwapper.OrderWapper;
import com.ymttest.utils.TestDataManager;
/**
*修改物流单号接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_ModifyOrSupplementBillNo {

	private static ModifyOrSupplementBillNoReq modifyOrSupplementBillNoReq;
	private static ModifyOrSupplementBillNoCall modifyOrSupplementBillNoCall;
	
	private static String xloboBillNo = "DB2533011979US";

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("修改或补录运单号接口");
	}

	@Before
	public void caseUp() {
		modifyOrSupplementBillNoReq = new ModifyOrSupplementBillNoReq();
		modifyOrSupplementBillNoCall = new ModifyOrSupplementBillNoCall();
		
		String accountid1;
		try {
			accountid1 = AccountCallServiceV2.getAccountId(20238699);
			AccountCallServiceV2.resetAccount(accountid1, new BigDecimal(
					9000000), new BigDecimal(0));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(modifyOrSupplementBillNoCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	/**
	 * 
	 * @param expectCheckResultList
	 */
	private void verify(List<ExpectCheckResult> expectCheckResultList) {

		DeliveryCheckResp resp = modifyOrSupplementBillNoCall.getDeliveryCheckResp();

		List<DeliveryCheckResult> billNoCheckResults = resp.getResults();

		int i = 0;
		
		boolean domesticDelivery = expectCheckResultList.stream()
				.anyMatch(
						expectCheckResult -> expectCheckResult
								.getModifyOrSupplementBillNoInfo()
								.getDeliverySection() == 3);

		for (ExpectCheckResult expectcheckResultInfo : expectCheckResultList) {

			DeliveryCheckResult checkResult = billNoCheckResults.get(i);

			Logger.verifyEquals(expectcheckResultInfo.isBizSuccess(),
					checkResult.isBizSuccess(), "校验BizSuccess");

			if (checkResult.isBizSuccess()) {
				
				// 进口贸易和第三方保税强制发国内
				if (expectcheckResultInfo.getLogisticsType() == 1
						|| expectcheckResultInfo.getLogisticsType() == 4)
					expectcheckResultInfo.getModifyOrSupplementBillNoInfo().setDeliverySection(
							3);
				
				// 交易订单状态数据
				verifyOrderStatus(expectcheckResultInfo.getModifyOrSupplementBillNoInfo(),
						modifyOrSupplementBillNoReq.getSellerId(), false, expectcheckResultInfo.getOrderStatus(), domesticDelivery);
			}

			Logger.verifyEquals(expectcheckResultInfo.getBizCode(),
					checkResult.getBizCode(), "校验bizCode");

			Logger.verifyEquals(expectcheckResultInfo.getBizMsg(),
					checkResult.getBizMsg(), "校验bizMsg");

			Logger.verifyEquals(expectcheckResultInfo.getModifyOrSupplementBillNoInfo()
					.getBillNo(), checkResult.getBillNo(), "校验billNo");

			Logger.verifyEquals(modifyOrSupplementBillNoReq.getOrderId(),
					checkResult.getOrderId(), "校验orderId");


			Logger.verifyEquals(expectcheckResultInfo.getModifyOrSupplementBillNoInfo()
					.getYmtExpressCode(), checkResult.getYmtExpressCode(),
					"校验ymtExpressCode");

			i++;
		}
	}

	/**
	 * 校验订单表状态，单主状态操作日志表
	 */
	private void verifyOrderStatus(ModifyOrSupplementBillNoInfo info, long sellerId,
			boolean isShippedByXlobo, Integer orderStatus, boolean domesticDelivery) {

		OrderShardingWapper orderShardingWapper = new OrderShardingWapper();

		long orderId = modifyOrSupplementBillNoReq.getOrderId();

		// 订单表(order)
		OrderPo ymtOrders = orderShardingWapper.selectOrderbyOrderId(orderId);

		Logger.comment(String.format("验证订单表(order)表 orderId: %s", orderId));

		Logger.verifyEquals(orderStatus, ymtOrders.getOrderStatus(), "验证orderStatus");

		Logger.verifyEquals(
				info.getYmtExpressCode()
						.equalsIgnoreCase("Y068"), ymtOrders
						.getXloboDelivery(), "验证xloboDelivery");

		Logger.verifyEquals(domesticDelivery, ymtOrders.getDomesticDelivery(),
				"验证domesticDelivery");

		Logger.verifyEquals(true,
				Utils.calcTimeSpanMin(ymtOrders.getDeliveryTime()) < 2,
				"验证数据库deliveryTime跟系统当前时间差为2分钟内");
		
		verifyMysqlDb(info, sellerId, ymtOrders.getLogisticsType(), ymtOrders.getOfficialLogistics());
	}

	/**
	 * 校验 mysql delivery 表
	 * 
	 * @param info
	 */
	private void verifyMysqlDb(ModifyOrSupplementBillNoInfo info, long sellerId,
			int logisticsType, Boolean officialLogistics) {

		long orderId = modifyOrSupplementBillNoReq.getOrderId();
		
		DeliveryPo actualDeliveryPo = new OrderWapper()
				.selectDeliveryByOrderIdAndBillCode(orderId, info.getBillNo());

		Logger.comment("校验 delivery 表数据 billNo: " + info.getBillNo());

		Logger.verifyEquals(info.getYmtExpressCode(),
				actualDeliveryPo.getYmtExpressCode(), "验证数据库YmtExpressCode");

		Logger.verifyEquals(Utils.falseIfNull(officialLogistics), actualDeliveryPo.getOfficalLogistics(),
				"验证数据库OfficalLogistics");

		Logger.verifyEquals(orderId, actualDeliveryPo.getOrderId(),
				"验证数据库OrderId");

		Logger.verifyEquals(sellerId, actualDeliveryPo.getSellerId(),
				"验证数据库SellerId");

		Logger.verifyEquals(logisticsType, actualDeliveryPo.getLogisticsType(),
				"验证数据库LogisticsType");

		Logger.verifyEquals(false, actualDeliveryPo.getDeleted(),
				"验证数据库Deleted");

		Logger.verifyEquals(info.getSource(),
				actualDeliveryPo.getSource(), "验证数据库Source");
		
		Logger.verifyEquals(false, actualDeliveryPo.getSourceTrack(),
				"验证数据库SourceTrack");

		Logger.verifyEquals(info.getBillNo(), actualDeliveryPo.getBillNo(),
				"验证数据库BillNo");

		Logger.verifyEquals(info.getDeliverySection(),
				actualDeliveryPo.getSection(), "验证数据库Section");

		Logger.verifyEquals(info.getMobile(), actualDeliveryPo.getMobile(),
				"验证数据库Mobile");
		
		Logger.verifyEquals(
				Utils.falseIfNull(info.getAuthenticatePackage()) ? 1 : 0,
				actualDeliveryPo.getPackageType(), "验证数据库PackageType");
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_001() {
		Logger.start(true, "境外发货 国际段  补录国际段物流信息成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_002() {
		Logger.start(true, "境外发货 国际段  订单没有发货，补录物流信息失败");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingSyncService.getSyncResult(orderId);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.orderStatusShipped
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.orderStatusShipped
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);

							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_003() {
		Logger.start(true, "境外发货  国际段 补录国内物流信息失败");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_004() {
		Logger.start(true, "境外发货  国际段 补录重复的物流信息失败（返回成功，但是不会插入数据）");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String billNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(billNo);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_008() {
		Logger.start(true, "海外发货 国际段  补录国际段，使用顺丰国际发货未传入手机号，发货失败");
		try {

			long sellerId = 3383;
			String sellerName = "wesper";
			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService.placeOrder(
					LogisticsTypeEnum.OVERSEAS_DELIVERY, sellerId, sellerName);

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y136");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.expressCompanyNeedMobile
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.expressCompanyNeedMobile
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_009() {
		Logger.start(true, "补录的billNo长度超过50，发货失败");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(5000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(51));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(),
					true, "校验IsSuccess");
			Logger.verifyEquals(modifyOrSupplementBillNoCall.getDeliveryCheckResp()
					.getResults().get(0).getBizMsg(), "面单号超过最大长度",
					"校验BizMsg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_010() {
		Logger.start(true, "进口贸易  补录国内顺丰运单，不输入手机号，发货成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.China);
			
			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.China, 3);
			TradingSyncService.getSyncResult(orderId);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_011() {
		Logger.start(true, "进口贸易  补录国际段运单，补录成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.China);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.China, 3);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(1);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_012() {
		Logger.start(true, "第三方保税  补录国内段运单，补录成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.BondedDelivery);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.China, 3);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(4);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_013() {
		Logger.start(true, "海外发货  使用官方物流，鉴定包裹，补录第三方物流公司失败");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceAuthenticateCallService
					.placeOrderWithAuthenticateAndOfficialLogistics(AuthenticateFreightTypeEnum.BUYER,
							BigDecimal.ONE, AuthenticateFeeTypeEnum.BUYER,
							BigDecimal.TEN);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.xloboDelivery
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.xloboDelivery
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_015() {
		Logger.start(true, "海外发货  非官方物流，鉴定包裹，补录多个鉴定包裹失败");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceAuthenticateCallService
					.placeOrderWithAuthenticate(AuthenticateFreightTypeEnum.BUYER,
							BigDecimal.ONE, AuthenticateFeeTypeEnum.BUYER,
							BigDecimal.TEN);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService
			.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1, true);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setAuthenticatePackage(true);
			
			ModifyOrSupplementBillNoInfo dInfo2 = new ModifyOrSupplementBillNoInfo();

			dInfo2.setBillNo(TestDataManager.getRandomNum(13));
			dInfo2.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo2.setDeliverySection(3);
			dInfo2.setYmtExpressCode("Y013");
			dInfo2.setAuthenticatePackage(true);

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo, dInfo2));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.moreAuthenticatePackage
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.moreAuthenticatePackage
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_016() {
		Logger.start(true, "境外发货 国际段  修改国际段物流信息成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_017() {
		Logger.start(true, "境外发货 国际段  输入错误的oldBillNo，修改物流信息失败");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo + "15213516");
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.modifyDeliveryInfoNotExists
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.modifyDeliveryInfoNotExists
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_018() {
		Logger.start(true, "境外发货  国际段 修改一个已经存在的物流单号，修改成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(oldBillNo);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(null);

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_019() {
		Logger.start(true, "海外发货 国际段  修改使用顺丰国际，未传入手机号，修改失败");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(oldBillNo);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y136");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.expressCompanyNeedMobile
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.expressCompanyNeedMobile
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_020() {
		Logger.start(true, "修改的billNo长度超过50，发货失败");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);
			
			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.randomStr(51));
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y136");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(),
					true, "校验IsSuccess");
			Logger.verifyEquals(modifyOrSupplementBillNoCall.getDeliveryCheckResp()
					.getResults().get(0).getBizMsg(), "面单号超过最大长度",
					"校验BizMsg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_021() {
		Logger.start(true, "进口贸易  修改国内顺丰运单，不输入手机号，修改成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.China);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.China, "Y013", 3);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y136");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(7);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_022() {
		Logger.start(true, "第三方保税  修改国内段运单，修改成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.BondedDelivery);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.BondedDelivery, "Y013", 3);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y136");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(4);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_023() {
		Logger.start(true, "海外发货  使用官方物流，鉴定包裹，补录多个非鉴定包裹失败");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceAuthenticateCallService
					.placeOrderWithAuthenticateAndLogisticsType(AuthenticateFreightTypeEnum.BUYER,
							BigDecimal.ONE, AuthenticateFeeTypeEnum.BUYER,
							BigDecimal.TEN, LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1, true);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			
			ModifyOrSupplementBillNoInfo dInfo2 = new ModifyOrSupplementBillNoInfo();

			dInfo2.setBillNo(TestDataManager.getRandomNum(13));
			dInfo2.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo2.setDeliverySection(3);
			dInfo2.setYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo, dInfo2));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.authenticateOrderNormalPackage
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.authenticateOrderNormalPackage
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_024() {
		Logger.start(true, "第三方保税  修改的物流单号，被其他包裹使用过，修改失败");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.BondedDelivery);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService
					.delivery(sellerId, orderId, LogisticsTypeEnum.BondedDelivery, 3);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo("1122574410889");
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setAuthenticatePackage(true);
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.billNoRepeat
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.billNoRepeat
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_025() {
		Logger.start(true, "进口贸易 鉴定包裹 修改的物流单号被非鉴定包裹过，修改失败");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceAuthenticateCallService
					.placeOrderWithAuthenticateAndLogisticsType(
							AuthenticateFreightTypeEnum.SELLER, BigDecimal.ONE,
							AuthenticateFeeTypeEnum.SELLER, BigDecimal.TEN,
							LogisticsTypeEnum.China);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.China, "Y013", 3, true);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo("1122574410889");
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.billNoRepeat
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.billNoRepeat
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_026() {
		Logger.start(true, "进口贸易 鉴定包裹 修改的物流单号被非鉴定包裹过，修改失败");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceAuthenticateCallService
					.placeOrderWithAuthenticateAndLogisticsType(
							AuthenticateFreightTypeEnum.SELLER, BigDecimal.ONE,
							AuthenticateFeeTypeEnum.SELLER, BigDecimal.TEN,
							LogisticsTypeEnum.China);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.China, "Y013", 3, true);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo("1122574410889");
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.billNoRepeat
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.billNoRepeat
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_027() {
		Logger.start(true, "海外发货  使用官方物流，修改物流公司，使用第三方物流公司，修改失败");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceAuthenticateCallService
					.placeOrderWithAuthenticateAndOfficialLogistics(AuthenticateFreightTypeEnum.BUYER,
							BigDecimal.ONE, AuthenticateFeeTypeEnum.BUYER,
							BigDecimal.TEN);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y068", 1, true);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y068");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.xloboDelivery
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.xloboDelivery
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_028() {
		Logger.start(true, "海外发货  使用贝海物流发货，修改物流公司，使用其他物流公司，修改成功");
		try {
			
			// 该用例，虽然修改使用了其他物流公司发货，但是订单表中的xloboDelivery根据第一次贝海物流发货
			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			DeliveryService.deleteDeliverByBillNo(xloboBillNo);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y068", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y068");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_029() {
		Logger.start(true, "海外发货  国际段发货，修改物流单号为其他进口贸易的国内段运单号，修改成功");
		try {
			
			// 国际段发货
			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);
			
			// 国内段发货
			TradingServiceResp placeOrderResp2 = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.China);
			long orderId2 = placeOrderResp2.getOrderList().get(0).getOrderId();
			
			TradingCallService.payOrder(userId, placeOrderResp2.getPayableAmount(), placeOrderResp2.getMainOrderId());

			TradingCallService.sellerAcceptOrder(sellerId, orderId2);
			TradingSyncService.getSyncResult(orderId2);

			String oldBillNo2 = TradingCallService.delivery(sellerId, orderId2,
					LogisticsTypeEnum.China, "Y013", 3);
			TradingSyncService.getSyncResult(orderId2);

			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(oldBillNo2);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.billNoRepeat
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.billNoRepeat
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_030() {
		Logger.start(true, "海外发货  国际段发货，修改物流单号为其他第三方保税的国内段运单号，修改成功");
		try {
			
			// 国际段发货
			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);
			
			// 国内段发货
			TradingServiceResp placeOrderResp2 = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.BondedDelivery);
			long orderId2 = placeOrderResp2.getOrderList().get(0).getOrderId();
			
			TradingCallService.payOrder(userId, placeOrderResp2.getPayableAmount(), placeOrderResp2.getMainOrderId());

			TradingCallService.sellerAcceptOrder(sellerId, orderId2);
			TradingSyncService.getSyncResult(orderId2);

			String oldBillNo2 = TradingCallService.delivery(sellerId, orderId2,
					LogisticsTypeEnum.BondedDelivery, "Y013", 3);
			TradingSyncService.getSyncResult(orderId2);

			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(oldBillNo2);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.billNoRepeat
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.billNoRepeat
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_031() {
		Logger.start(true, "海外发货  进口贸易国内段发货，修改物流单号为境外发货的国际段单号，修改失败");
		try {
			
			// 国际段发货
			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);
			
			// 国内段发货
			TradingServiceResp placeOrderResp2 = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.China);
			long orderId2 = placeOrderResp2.getOrderList().get(0).getOrderId();
			
			TradingCallService.payOrder(userId, placeOrderResp2.getPayableAmount(), placeOrderResp2.getMainOrderId());

			TradingCallService.sellerAcceptOrder(sellerId, orderId2);
			TradingSyncService.getSyncResult(orderId2);

			String oldBillNo2 = TradingCallService.delivery(sellerId, orderId2,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 3);
			TradingSyncService.getSyncResult(orderId2);

			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(oldBillNo);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo2);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId2);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.billNoRepeat
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.billNoRepeat
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_032() {
		Logger.start(true, "海外发货  国内段和国际段物流单号互换，修改成功");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			// 国际段发货
			String oldBillNo1 = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);
			
			// 国内段发货
			String oldBillNo2 = TradingCallService.modifyOrSupplementBillNo(
					orderId, sellerId, "Y013", 3);
			TradingSyncService.getSyncResult(orderId);

			Thread.sleep(3000);
			
			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(oldBillNo2);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo1);
			dInfo.setOldYmtExpressCode("Y013");
			
			ModifyOrSupplementBillNoInfo dInfo2 = new ModifyOrSupplementBillNoInfo();

			dInfo2.setBillNo(oldBillNo1);
			dInfo2.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo2.setDeliverySection(3);
			dInfo2.setYmtExpressCode("Y013");
			dInfo2.setOldBillNo(oldBillNo2);
			dInfo2.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo, dInfo2));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_033() {
		Logger.start(true, "国内贸易 鉴定包裹和非鉴别包裹物流单号互换，修改成功");
		try {
			
			TradingServiceResp placeOrderResp = TradingPlaceAuthenticateCallService
					.placeOrderWithAuthenticateAndLogisticsType(
							AuthenticateFreightTypeEnum.SELLER, BigDecimal.ONE,
							AuthenticateFeeTypeEnum.SELLER, BigDecimal.TEN,
							LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			// 国际段发鉴别包裹
			String oldBillNo1 = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, "Y013", 1, true);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);
			
			// 国内段发货补录
			String oldBillNo2 = TradingCallService.modifyOrSupplementBillNo(
					orderId, sellerId,
					"Y013", 3, true);
			TradingSyncService.getSyncResult(orderId);

			Thread.sleep(3000);
			
			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(oldBillNo2);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo1);
			dInfo.setOldYmtExpressCode("Y013");
			dInfo.setAuthenticatePackage(true);
			
			ModifyOrSupplementBillNoInfo dInfo2 = new ModifyOrSupplementBillNoInfo();

			dInfo2.setBillNo(oldBillNo1);
			dInfo2.setAuthenticatePackage(true);
			dInfo2.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo2.setDeliverySection(3);
			dInfo2.setYmtExpressCode("Y013");
			dInfo2.setOldBillNo(oldBillNo2);
			dInfo2.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo, dInfo2));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_034() {
		Logger.start(true, "海外物流  ，使用国内段的物流单号修改国际段单号，补录成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(13);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_035() {
		Logger.start(true, "海外物流  ，使用多个旧的国内段重复的物流单号修改多个国内段运单号，修改补录成功");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String oldBillNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(TestDataManager.getRandomNum(13));
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(1);
			dInfo.setYmtExpressCode("Y013");
			dInfo.setOldBillNo(oldBillNo);
			dInfo.setOldYmtExpressCode("Y013");
			
			ModifyOrSupplementBillNoInfo dInfo2 = new ModifyOrSupplementBillNoInfo();

			dInfo2.setBillNo(TestDataManager.getRandomNum(13));
			dInfo2.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo2.setDeliverySection(1);
			dInfo2.setYmtExpressCode("Y013");
			dInfo2.setOldBillNo(oldBillNo);
			dInfo2.setOldYmtExpressCode("Y013");
			
			ModifyOrSupplementBillNoInfo dInfo3 = new ModifyOrSupplementBillNoInfo();

			dInfo3.setBillNo(TestDataManager.getRandomNum(13));
			dInfo3.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo3.setDeliverySection(1);
			dInfo3.setYmtExpressCode("Y013");
			dInfo3.setOldBillNo(oldBillNo);
			dInfo3.setOldYmtExpressCode("Y013");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo, dInfo2, dInfo3));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.passed
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.passed
												.getMessage());

								expectCheckResult.setBizSuccess(true);
								expectCheckResult.setValidation(true);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ModifyOrSupplementBillNo_036() {
		Logger.start(true, "海外物流  ，使用互斥的物流公司发货，修改补录失败");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);

			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();

			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();

			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingSyncService.getSyncResult(orderId);
			
			String billNo = TradingCallService.delivery(sellerId, orderId,
					LogisticsTypeEnum.OVERSEAS_DELIVERY, 1);
			TradingSyncService.getSyncResult(orderId);
			
			Thread.sleep(3000);

			ModifyOrSupplementBillNoInfo dInfo = new ModifyOrSupplementBillNoInfo();

			dInfo.setBillNo(billNo);
			dInfo.setSource(1);

			// 发货节点、1国际段,2转运段,3国内段
			dInfo.setDeliverySection(3);
			dInfo.setYmtExpressCode("Y014");

			modifyOrSupplementBillNoReq.setBillNoInfoList(Lists.newArrayList(dInfo));
			modifyOrSupplementBillNoReq.setOrderId(orderId);
			modifyOrSupplementBillNoReq.setSellerId(sellerId);

			modifyOrSupplementBillNoCall.setData(modifyOrSupplementBillNoReq);
			modifyOrSupplementBillNoCall.callService();

			Logger.verifyEquals(modifyOrSupplementBillNoCall.getSuccess(), true,
					"校验IsSuccess");

			List<ExpectCheckResult> list = new ArrayList<ExpectCheckResult>();

			modifyOrSupplementBillNoReq
					.getBillNoInfoList()
					.forEach(
							item -> {

								ExpectCheckResult expectCheckResult = new ExpectCheckResult(
										item);

								expectCheckResult
										.setBizCode(CheckBizResultEnum.billNoRepeat
												.getCode());
								expectCheckResult
										.setBizMsg(CheckBizResultEnum.billNoRepeat
												.getMessage());

								expectCheckResult.setBizSuccess(false);
								expectCheckResult.setValidation(false);

								expectCheckResult.setLogisticsType(10);
								expectCheckResult.setMicroShopOrder(false);
								expectCheckResult.setOrderStatus(3);

								list.add(expectCheckResult);
							});
			
			Thread.sleep(5000);

			verify(list);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}